home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 April
/
CMCD0404.ISO
/
Software
/
Shareware
/
Programare
/
sharp
/
wwwSharp_setup.exe
/
{app}
/
Examples
/
RssPublisher
/
Data
/
testdb.js
< prev
Wrap
Text File
|
2004-02-04
|
822b
|
20 lines
var connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;"
var cat = new ActiveXObject("ADOX.Catalog")
cat.Create(connStr);
cat = null;
var conn = new ActiveXObject("ADODB.Connection");
conn.Open(connStr);
conn.Execute("CREATE TABLE [Articles] ([ID] AutoIncrement, [Title] VarChar(255), " +
"[Description] Memo, [URL] VarChar(255), [Date] VarChar(80), [Category] VarChar(50), " +
"[Keywords] VarChar(255), [Author] VarChar(255), [Email] VarChar(255))");
for (i=1; i<=10; i++)
{
conn.Execute("INSERT INTO [Articles] ([Title], [Description], [URL], [Date], " +
"[Category], [Keywords], [Author], [Email]) VALUES ('Article " + i + "', " +
"'Description for article " + i + "', 'http://mysite.com/article" + i + ".html', " +
"Now(), 'News', '', 'Me', 'my@email.com')");
}